#ifndef __ELEMENT_DTD__
#define __ELEMENT_DTD__

#include <vector>
#include <map>
#include <string>
#include "AttributeDTD.h"
#include "StructureDTD.h"

class ElementDTD
{
	private:
		string name;
		//vector<AttributeDTD*> atts;
		std::map<string, AttributeDTD*> atts;
		StructureDTD * s;

	public:
		ElementDTD(const char *name, StructureDTD * s);

        	string getName() const;

		/**Add an attribute to the ElementDTD
		@return -1 if the attribute already exists 
			0 in the other cases*/
		int addAttribute(AttributeDTD* att);

		/**Find out if an attribute exists according its name 
		@return NULL if the attribute does not exist
			The AttributeDTD if it exists */
		AttributeDTD* getAttributeByName(string name) const;

		/**Print the structure associate to ChoiceDTD*/
		virtual void display() const;

		/**Get the children of the element
		@return NULL if the structure oh the element is not 
			     a composed structure 
			A vector with all the children in the other cases*/
		vector<string> * getChildren() const;

		/** Get the regular expression corresponding to the ElementDTD **/
		string getRegExp() const;
		virtual ~ElementDTD () {}
};

#endif
